The present invention relates to a filling apparatus for filling an interior of a polygon drawn with a single stroke displayed on a scanning display unit.
In a graphic display unit displaying graphic data on a scanning display, or the like, there hitherto has been adopted a filling method for filling an interior of a polygon drawn with a single stroke displayed on a display unit, so as to visually recognize the polygon easier.
In the scanning display mentioned above, there are a variety of shapes of the polygon to be filled on the scanning display, and such polygons can be classified roughly into two groups, one group of which contains, as shown in FIG. 10, a shape marking off only one lot of each scanning line (hereinafter referred to as an A-type polygon), and the other of which contains, as shown in FIG. 11, a shape marking off two or more lots of each scanning line (hereinafter referred to as a B-type polygon).
As far as the A-type polygon is concerned, the polygon can be filled on the display by simply filling a region between intersection points of the scanning line and the side lines of the polygon, while as to the B-type polygon, there exists two or more pairs of intersection points of the scanning line and the side lines of the polygon. Thus, there is a need to discriminate specific lots, to be filled among lots each of which lies between intersection points in order to grasp the shape of the figure.
Considering the above points, a filling method is conventionally adopted as in the following.
(1) A method to fill an interior of a polygon is known to those skilled in the art as a water filling method. This method comprises sorting apex-data of a polygon along an operation-direction perpendicular to a direction of a scanning line, sorting along the direction of the scanning line if necessary, making a list of ridges on sides of the polygon, each side having intersection points with the scanning line, interpolating between corresponding ridges from a starting point to an ending point, and repeating the above-mentioned list-making process on all of the scanning lines to interpolate between corresponding ridges.
By the filling method mentioned above, any of A-type polygon and B-type polygon can be surely filled in the interior thereof.
However, in the above filling method, a sorting process along an operation direction is indispensable, and a ridge list must be made as a subject of calculation, thus there arises a problem that memories must be provided for sorting and maintaining the list.
Further, a number of processes must be handled by a central processing unit (hereinafter referred to as CPU) such as reading data, sorting, processing for execution, writing data, thereby a problem also arises that it takes a long time to display the filled polygon on the scanning display after apex-data for the polygon have been given.
(2) Another method of filling a polygon is provided only for filling an interior of an A-type polygon shown in FIG. 10, by preparing independently of the image memory for indication, a memory plane for working, drawing sides of the single-stroked polygon in the memory plane for working at the same time as drawing the same in the image memory for indication, and detecting the maximum value and the minimum value in a direction of certain coordinates of the closed loop data, wherein the above-mentioned closed loop data indicates a closed loop of a polygon where neighbouring apexes are interpolated on the basis of data of each apex of the polygon. While the closed loop data are read by scanning the memory plane for working only in a region determined from the maximum value and the minimum value, points are obtained where every scanning line intersects the closed loop, and a specific logical signal is written in the image memory or in the memory plane for working in correspondence with a pair of points of intersection, thereby generating plane image data where a region marked off by the closed loop is filled with specific data (see Japanese Patent Laid Open Publication No. 3069/1980, and Japanese Patent Laid Open Publication No. 3070/1980).
The above filling method, however, involves a problem in that there is provided only one circuit for linear interpolation, and a special memory independent of the image memory must be provided for plane-display, because it is unknown from which apex the interpolation of each ridge of the polygon should be started, by the given plural apex-data. The amount of the above-mentioned special memory becomes large. A still further problem is that it takes a long time to display a filled polygon on the scanning display after apex-data of the polygon have been given. This is because a long time is spent in reading data from the memory and writing data to the memory for plane-display and also a long time is spent in searching for a starting point and an ending point on the processing scanning line for interpolation, thereby the linear interpolation circuit remains in a "wait" state for fairly a long time.
(3) Still another filling method can be adopted wherein the aforementioned method (1) is adopted when the polygon to be filled is a B-type polygon, and the aforementioned method (2) is adopted when the polygon to be filled is an A-type polygon.
In such a method, a polygon can be filled without fail regardless of whether it is an A-type or B-type, and a necessary time for the filling process can be shortened as a whole.
However, the choice of which method (1) or (2) should be adopted for filling depends on the judgement of the user or operator. In the case that the user misjudges, a filling process is performed under an unsuitable filling method. Therefore, this method (3) involves a problem that a high speed filling process cannot be realized, and another problem is that a sure filling process might not be performed.